package com.hymjweb.demo.hymj.log_manage.controller;

import com.hymjweb.demo.hymj.log_manage.service.XtBackupLogMsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author DaTing created on 2020-10-06
 **/
@Controller
@RequestMapping("/pages/system_maintain/sys_log")
public class XtBackupLogMsgController {

    @Autowired
    private XtBackupLogMsgService xtBackupLogMsgService;

    @RequestMapping("/init")
    public String init(HttpServletRequest request) {
        return "pages/system_maintain/sys_log/logInit";
    }

    @RequestMapping("/query")
    @ResponseBody
    public Object query(@RequestParam(required = false) Map param) throws Exception {
        if(param!=null){
            return xtBackupLogMsgService.getPageList(param);
        }
        else{
            throw new Exception("查询参数错误");
        }
    }

}
